define(["vue","text!infoHtml","jquery"],function(vue,html,$){
    return vue.extend({
        template: html,
        data:function(){
            return {
                infoTimer: 0,
                dialogFormVisible:false,
                formLabelWidth: '80px',
                info:[]
            };
        },
        created:function(){
            this.$options.methods.searchInfoInterval(this);
        },
        beforeDestroy:function(){
            clearInterval(this.infoTimer);
            this.infoTimer = 0;
        },
        /** 方法 */
        methods:{
            /** 查询信息前150条 infos*/
            searchInfoInterval(thisObj){
                if(thisObj.infoTimer ==0){
                    thisObj.infoTimer = setInterval(function(){
                        $.ajax({
                            url:"/scheduling/infos",
                            type:"get",
                            dataType:"json",
                            success:function(data){
                                if(data.code == '0'){
                                    thisObj.info = data.data;
                                }else{
                                    thisObj.$options.methods.alertInfo('error','查询异常',thisObj);
                                }
                            }
                        });
                    },5000);
                }
            },
            alertInfo(type,message,thisObj){
                thisObj.$message({
                    showClose: true,
                    message: message,
                    type: type
                });
            }
        }
    });
})